package com.itheima;

/**
 * 2025/3/29 11:49
 * 斗地主游戏做牌
 */
public class ArrayPractice4 {
    public static void main(String[] args) {
        String[] colors = {"♥", "♠", "♣", "♦"};//♦ ♠ ♥ ♣ 静态初始化数组
        String[] numbers = {"2", "A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3"};
        //存储扑克的数组
        String[] cards = new String[54];//动态数组
        //定义一个索引，代表当前cards数组中要放元素的位置
        int index = 0;
        for (int i = 0; i < colors.length; i++) {
            String color = colors[i];
            for (int j = 0; j < numbers.length; j++) {
                String number = numbers[j];
                //color+number = card
                String card = color + number;
                //将card放入cards中
//                cards[index] = card;
//                //怎么维护index
//                index++;
                cards[index++] = card;
            }
        }
        //添加大小王
        cards[52] = "大王";//第53
        cards[53] = "小王";//第54
        System.out.println("------------------------");

        for (String card : cards) {
            System.out.print(card + "\t");
        }

    }
}
